import React from 'react';
import { connect } from 'dva';
import LoginComponent from '../../components/Login/Login';

function Login({ dispatch, login }) {
  const LoginProps = {
    login,
    onLogin: userlogin,
  };

  function userlogin(param) {
    dispatch({
      type: 'login/login',
      payload: param,
    });
  }

  return (
    <div>
      <LoginComponent {...LoginProps} />
    </div>
  );
}

export default connect(({ login }) => ({ login }))(Login);
